package com.yh.service.impl;

import com.yh.dao.cluster.CityDao;
import com.yh.dao.master.UserDao;
import com.yh.domain.City;
import com.yh.domain.User;
import com.yh.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    @Resource
    private CityDao cityDao;

    @Override
    public User findByName(String userName) {
        User user = userDao.findByName(userName);
        City city = cityDao.findByName("郑州");
        user.setCity(city);
        return user;
    }
}
